import CryptoJS from "crypto-js"
const encryption = (param)=> {
  const key = CryptoJS.enc.Utf8.parse('MC6AXG3CY9IZ5JP0') // 十六位十六进制数作为密钥
  const iv = CryptoJS.enc.Utf8.parse('UMGQ5FDGFS3Z6UGP') // 十六位十六进制数作为密钥偏移量
  const newParam = CryptoJS.enc.Utf8.parse(param) // 需要加密的数据
  const encrypted = CryptoJS.AES.encrypt(newParam, key, { iv: iv, mode: CryptoJS.mode.CBC, padding: CryptoJS.pad.Pkcs7 })
  const result = encrypted.ciphertext.toString().toLowerCase()
  return result
}

export default encryption
